Imports MIMS.WRS.Entities
Imports MIMS.WRS.Business
Imports MyFramework

Public Class Start
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents rptList As MyFramework.Web.UI.WebControls.Repeater
    Protected WithEvents crContent As MyFramework.Web.UI.WebControls.ContentRegion
    Protected WithEvents pageTitle As MyFramework.Web.UI.WebControls.ContentRegion
    Protected WithEvents Masterpage1 As MyFramework.Web.UI.WebControls.MasterPage
    Protected WithEvents txtGeneralEnquiry As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtEmailAddr As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtName As System.Web.UI.WebControls.TextBox
    Protected WithEvents LinkButton1 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents lnkSendEmail As System.Web.UI.WebControls.LinkButton

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not IsPostBack Then
            Dim totalRecords As Integer

            rptList.DataSource = ConPointService.GetConPointsListForIDS()
            rptList.DataBind()

        End If
        lnkSendEmail.Attributes.Add("onclick", "javascript:return ValidateEmail();")
    End Sub

    Private Sub lnkSendEmail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnkSendEmail.Click
        Try
            Dim sendGeneralEnquiryObj As SendGeneralEnquiry = New SendGeneralEnquiry
            With sendGeneralEnquiryObj
                .GeneralEnquiry = txtGeneralEnquiry.Text
                .CustomerEmail = txtEmailAddr.Text.Trim()
                .CustomerName = txtName.Text.Trim()
            End With

            sendGeneralEnquiryObj.Send(sendGeneralEnquiryObj.CustomerEmail)

        Catch ex As Exception
            Logger.Error("Failed to send SendShoppingListEmail", ex)
        End Try
    End Sub
End Class
